package Person.Fanshe.ith_02;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

public class ReflectDemo01 {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
        //获取class对象
        Class<?> c = Class.forName("Person.Fanshe.ith_01.Student");
        Constructor<?>[] cons = c.getDeclaredConstructors();
        // Constructor<?>[] cons = c.getConstructors();
        for(Constructor con:cons){
            System.out.println(con);
        }
        System.out.println("***************");
        Constructor<?> con = c.getConstructor();

Object obj = con.newInstance();
        System.out.println(obj);
    }
}
